package cn.hdmis.bean;

import java.util.ArrayList;
import java.util.List;

public class PageBean {
	
	private int totalCount = 0; // 记录总数

	private int pageSize = 20; // 每页显示记录数

	private int pageCount = 0; // 总页数

	private int currentPage = 1; // 当前页数
	
	private String 	orderBy;//排序字段
	
	private String 	order; //排序 ASC DESC
	
	private List<Object> recordList = new ArrayList<Object>();
	
	public int getFirstindex() {
		return (currentPage-1)*pageSize;
	}

	public int getTotalCount() {
		return totalCount;
	}

	public void setTotalCount(int totalCount) {
		this.totalCount = totalCount;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		if(pageSize<=0){
			pageSize = 30;
		}else{
			this.pageSize = pageSize;
		}
	}

	public int getPageCount() {
		int mod = totalCount % pageSize;
		if(mod>0){
			return totalCount / pageSize+1;
		}else{
			return totalCount / pageSize;
		}
	}

	public void setPageCount(int pageCount) {
		this.pageCount = pageCount;
	}

	public int getCurrentPage() {
		return currentPage;
	}

	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}

	public String getOrderBy() {
		return orderBy;
	}

	public void setOrderBy(String orderBy) {
		this.orderBy = orderBy;
	}

	public String getOrder() {
		return order;
	}

	public void setOrder(String order) {
		this.order = order;
	}

	public List<Object> getRecordList() {
		return recordList;
	}

	public void setRecordList(List<Object> recordList) {
		this.recordList = recordList;
	}


	
}
